
<template>
  <div class="contentBox">
    <el-carousel height="600px" :interval="5000" arrow="always">
      <el-carousel-item v-for="item in imglist" :key="item.id" @click="JumpAdvertising(item.jump_url)">
        <img style="width: 100%;" :src="item.image" alt="">
      </el-carousel-item>
    </el-carousel>
  </div>
</template>
  
<script lang="ts" setup>

import { ref, reactive, defineProps, useAttrs } from "vue";
import { useRouter } from "vue-router";
const props = defineProps({
  imglist: {
    type: Array as () => Array<any>, //(string也可以是其他你自定义的接口)
    required: true,
    default: () => []
  }
});

const router = useRouter()

const JumpAdvertising = (index: string) => {
  console.log(123);
  router.push(index)
}
</script>
  
  
<style scoped lang="less">
.contentBox {
  max-width: 1920px;
  height: 600px;
  margin: 0 auto;
  background: #f5f5f5;

  img {
    width: 100%;
    height: 100%;
  }
}
</style>
  